﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Zeus.Mvc.Loggers;

namespace Zeus.Mvc.ConsoleHost.Test
{
    public class Logger : Loggers.Implementations.DefaultHttpContextLogger
    {
        public Logger(ILogger<Logger> logger)
        {

        }

        protected override async Task<IHttpContextModel> BuildRequestModel(HttpContext httpContext)
        {
            var requestModel = await base.BuildRequestModel(httpContext);


            return requestModel;
        }

        protected override async Task<IHttpContextModel> BuildResponseModel(HttpContext httpContext)
        {
            var response = await base.BuildResponseModel(httpContext);
            Task.Run(() =>
            {
                Task.Delay(1000).Wait();
            }).ContinueWith(result =>
            {

            }, TaskContinuationOptions.OnlyOnFaulted);
            return response;
        }
    }
}
